package com.example.eightapi.service.Impl;

import com.example.eightapi.mapper.loginMapper;
import com.example.eightapi.pojo.users;
import com.example.eightapi.service.loginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class loginServiceImpl implements loginService {
    @Autowired
    private loginMapper loginmapper;


    @Override
    public boolean authenticate(String username, String password) {
        users user = loginmapper.findByUsername(username);
        return user != null && user.getPassword().equals(password);
    }

    @Override
    public void register(users user) {
        loginmapper.register(user);
    }

}
